package com.zto.sch.base.normal;

import org.junit.Test;
import sun.applet.Main;

import java.util.SortedMap;
import java.util.TreeMap;

/**
 * @program: sch-diy-parent
 * @description:
 * @author: sch
 * @create: 2021-01-06 14:17
 **/
public class TreeMapTailMap {
    @Test
    public void testTailMap() {
        TreeMap<Integer, String> treemap = new TreeMap<Integer, String>();
        SortedMap<Integer, String> treemapincl = new TreeMap<Integer, String>();

        // populating tree map
        treemap.put(2, "two");
        treemap.put(1, "one");
        treemap.put(3, "three");
        treemap.put(6, "six");
        treemap.put(5, "five");

        System.out.println("Getting tail map" + treemap);
        treemapincl = treemap.tailMap(3);
        System.out.println("Tail map values: " + treemapincl);
    }

}
